Skip to content

Move undelegated constants #13606

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Move undelegated constants #13606

wants to merge 1 commit into from

Conversation

lucylq
Copy link
Contributor

@lucylq lucylq commented Aug 22, 2025

Currently, the xnnpack + lora + program-data separation flow moves all delegated constants to the .ptd file. This change moves the undelegated constants as well, reducing the pte file bloat.

Run export_lora.sh from meta-pytorch/executorch-examples#54

-rw-r--r-- 1 lfq users 5994013600 Aug 22 13:32 foundation.ptd
-rw-r--r-- 1 lfq users   27628928 Aug 22 13:32 llama_3_2_1B_lora.pte
-rw-r--r-- 1 lfq users 5994013600 Aug 22 13:30 llama_3_2_1B.ptd
-rw-r--r-- 1 lfq users     317248 Aug 22 13:30 llama_3_2_1B.pte

fp32 Weights: ~6GB
Program: ~300KB
Lora adapter weights: ~27MB

Copy link

pytorch-bot bot commented Aug 22, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/13606

Note: Links to docs will display an error until the docs builds have been completed.

❌ 1 New Failure

As of commit d69aa0f with merge base fe84495 (image):

NEW FAILURE - The following job has failed:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Aug 22, 2025
Copy link

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

SpecPropPass(),
# ExecuTorch backend ops are unable to handle unbacked symints. So after
# this pass, passes cannot be Interpreter-based, because it will fail if
# there exists an unbacked symint operation.
EdgeToBackendOpsPass(),
RemoveGraphAssertsPass(),
*config.passes,
Copy link
Contributor Author

@lucylq lucylq Aug 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

external_constants_pass has to run after SpecPropPass, which populates the tensor names. See if CI passes, not sure if this will break anything.

@facebook-github-bot
Copy link
Contributor

@lucylq has imported this pull request. If you are a Meta employee, you can view this in D80840528.

@lucylq lucylq requested a review from mergennachin August 22, 2025 20:40
@lucylq lucylq force-pushed the lfq.lora-constants branch from 33c43bf to ffa0a57 Compare August 22, 2025 20:58
@facebook-github-bot
Copy link
Contributor

@lucylq has imported this pull request. If you are a Meta employee, you can view this in D80840528.

@lucylq lucylq force-pushed the lfq.lora-constants branch from ffa0a57 to d69aa0f Compare August 22, 2025 21:16
@facebook-github-bot
Copy link
Contributor

@lucylq has imported this pull request. If you are a Meta employee, you can view this in D80840528.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants